package com.yunsc.shop.controller.product;

import com.yunsc.common.utils.Result;
import com.yunsc.product.service.YunscGoodsCategoryService;
import com.yunsc.product.vo.GoodsCategoryVO;
import com.yunsc.shop.utils.ClientInfoUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * @version: 1.0
 * @Author: adan
 * @description:
 * @date: 2024-04-14 0:33
 */
@Api(value = "商品信息管理", tags = "商品分类接口")
@RestController
@RequestMapping("category")
public class GoodsCategoryController {

    @Resource
    private YunscGoodsCategoryService goodsCategoryService;
    @Resource
    private ClientInfoUtils clientInfoUtils;

    /**
     * 列表
     */
    @ApiOperation("查询商品分类接口")
    @GetMapping("/list")
    public Result<Map<String, Object>> list() {
        Integer currentStoreId = clientInfoUtils.getCurrentStoreId();
        List<GoodsCategoryVO> list = goodsCategoryService.queryGoodsCategory(currentStoreId);
        return Result.resultList(list);
    }



}
